<?php
namespace app\seller\controller;
use think\Input;
class Index extends Common{
    public function initialize(){
        parent::initialize(); 
    }
    public function index(){  
        if(isMobile()) $this->redirect('main');
        $this->assign('title','商户中心'); 
        return $this->fetch();
    }
    public function main(){  
        $shopid=session('seller.id');
        $cdata['order_no']=db('channel_order')->where('state','<',2)->where('shopid',$shopid)->count();
        $cdata['order_all']=db('channel_order')->where('shopid',$shopid)->count();
        $cdata['order_money_pay']=db('jiesuan')->where('shopid',$shopid)->sum('money_s');
        $cdata['order_money']=db('channel_order')->where('state',2)->where('shopid',$shopid)->sum('money');
        $cdata['channel_yes']=db('channel')->where('open',1)->where('shopid',$shopid)->count();
        $cdata['channel_all']=db('channel')->where('shopid',$shopid)->count();

        $this->assign('cdata',$cdata);
        $this->assign('title','主页');
        return $this->fetch(); 
    }
}